<template>
    <view>
        <!-- parse <include src="../component/navigationBar.wxml"></include> -->
        <block>
            <view class="navigationBox" :style="'padding-top:' + nTop + 'px;height:' + nHeight + 'px;line-height:' + nHeight + 'px;--color:' + color + ';'">
                <view class="nBar" :style="'height:' + nHeight + 'px;top:' + nTop + 'px'">
                    <navigator class="ico" hoverClass="none" :openType="pages.length == 1 ? 'switchTab' : 'navigateBack'" :url="pages.length == 1 ? '/pages/index/index4' : ''">
                        {{ pages.length == 1 ? '' : '' }}
                    </navigator>
                    <view class="title">{{ nTitle }}</view>
                </view>
            </view>
        </block>
        <view class="HELP" :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';'" v-if="flag != 0">
            <view class="h1">{{ D.h1 }}</view>
            <view class="c">
                <rich-text :nodes="D.c1"></rich-text>
            </view>
            <view class="h1">如何得到收益？</view>
            <view class="c">
                <view class="h2">1. 分享/发送我的专属二维码《推广海报》给好友</view>
                <navigator class="btn5 ico" hoverClass="none" :url="'/hnPages/tg/my_ewm?tguid=' + D.cook_tg_id"> 分享海报</navigator>
            </view>
            <view class="c">
                <view class="h2">2. 分享/发送会员《相亲卡》给好友，让Ta们加入我的单身团，获得收益</view>
                <navigator class="btn5 ico" hoverClass="none" :url="'/hnPages/tg/xqk_ulist?tguid=' + D.cook_tg_id"> 分享相亲卡</navigator>
            </view>
        </view>
        <view class="blank"></view>
        <!-- parse <include src="TG_btm_nav.wxml"></include> -->
        <block>
            <view
                class="btm_nav"
                :style="'--color:' + color + ';--rgbcolor:' + rgbcolor + ';--btmnavbg_color:' + btmnavbg_color + ';--btmnavbg_rgbcolor:' + btmnavbg_rgbcolor + ';'"
            >
                <view class="shadow"></view>
                <view class="navabox">
                    <navigator :class="'a ' + (btm_nav == 'index' ? ' ed' : '')" hoverClass="none" openType="redirect" :url="'index?tguid=' + tguid + '&admid=' + admid">
                        <view class="i">
                            <view class="image ico"></view>
                        </view>
                        <view class="font">首页</view>
                    </navigator>
                    <navigator :class="'a ' + (btm_nav == 'help' ? ' ed' : '')" hoverClass="none" openType="redirect" :url="'/hnPages/tg/help?tguid=' + tguid + '&admid=' + admid">
                        <view class="i">
                            <view class="image ico"></view>
                        </view>
                        <view class="font">帮助</view>
                    </navigator>
                    <navigator :class="'a ' + (btm_nav == 'msg' ? ' ed' : '')" hoverClass="none" openType="redirect" :url="'msg?tguid=' + tguid + '&admid=' + admid">
                        <view class="i">
                            <view class="image ico"></view>
                            <text class="span" v-if="btm_nav_msg_num > 0">{{ btm_nav_msg_num }}</text>
                        </view>
                        <view class="font">通知</view>
                    </navigator>
                    <navigator :class="'a ' + (btm_nav == 'my' ? ' ed' : '')" hoverClass="none" openType="redirect" :url="'my?tguid=' + tguid + '&admid=' + admid">
                        <view class="i">
                            <view class="image ico"></view>
                        </view>
                        <view class="font">我的</view>
                    </navigator>
                </view>
            </view>
            <view @tap="backtopFn" class="backtop fadeInUp" data-id="index" :style="'color:' + color" v-if="backtop_flag">
                <text class="ico icon-backtop"></text>
                顶部
            </view>
        </block>
    </view>
</template>
<script module="WXS" lang="wxs" src="@/res/www.a9a.cn.wxs"></script>
<script>
var t = require('../../@babel/runtime/helpers/defineProperty');
var a = require('../../res/www.a9a.cn.js');
var app = getApp();
export default {
    data() {
        return {
            nTitle: '推广奖励・说明',
            btm_nav: 'help',
            btmnavbg_color: '#B8BCCC',
            btmnavbg_rgbcolor: a.c16_rgb('#B8BCCC'),
            triggered: true,
            color: '',
            rgbcolor: '',
            tguid: '',
            admid: '',
            flag: '',
            btm_nav_msg_num: '',

            D: {
                h1: '',
                c1: '',
                cook_tg_id: ''
            },

            SHARE: '',
            backtop_flag: false,
            nTop: '',
            nHeight: '',
            pages: []
        };
    },
    onLoad: function (t) {
        var that = this;
        var n = 0;
        var r = 0;
        uni.setNavigationBarTitle({
            title: that.nTitle
        });
        app.globalData.get_config('_ZEAI').then(function (t) {
            that.setData({
                color: app.globalData._ZEAI.color,
                rgbcolor: a.c16_rgb(app.globalData._ZEAI.color)
            });
        });
        app.globalData.get_navigationBarTopHeight(that);
        if (a.ifint(t.tguid) || a.ifint(t.admid)) {
            n = a.ifint(t.tguid) ? t.tguid : 0;
            r = a.ifint(t.admid) ? t.admid : 0;
        }
        that.setData({
            tguid: n,
            admid: r
        });
        this.init();
    },
    onPullDownRefresh: function () {
        var that = this;
        uni.vibrateShort({
            type: 'heavy'
        });
        setTimeout(function () {
            that.setData({
                triggered: false
            });
            that.init();
        }, 500);
    },
    onShareAppMessage: function (t) {
        return {
            imageUrl: this.SHARE.imgurl,
            title: this.SHARE.title,
            path: '/hnPages/tg/help'
        };
    },
    onShareTimeline: function () {
        return {
            imageUrl: this.SHARE.imgurl,
            title: this.SHARE.title,
            query: '',
            path: '/hnPages/tg/help'
        };
    },
    methods: {
        init: function (t, e) {
            var that = this;
            uni.showLoading({
                title: '玩命加载中...',
                mask: true
            });
            false;
            var r = {
                submitok: 'HELP',
                openid: uni.getStorageSync('COOK_U').openid,
                tguid: that.tguid,
                admid: that.admid
            };
            app.globalData.ajax({
                url: 'tg.php',
                data: r,
                success: function (t) {
                    switch (
                        (uni.hideLoading(),
                        that.setData({
                            flag: t.flag
                        }),
                        t.flag)
                    ) {
                        case '1':
                        case 1:
                            uni.setNavigationBarTitle({
                                title: t.nTitle
                            });
                            that.setData({
                                nTitle: t.nTitle,
                                btm_nav_msg_num: t.btm_nav_msg_num,
                                D: t.D,
                                SHARE: t.SHARE
                            });
                            break;
                        case 'flag0':
                        case 'flag_1':
                        case 'flag2':
                            uni.reLaunch({
                                url: 'reg?t=' + t.flag
                            });
                            break;
                        default:
                            t.this = that;
                            t.url = 'no';
                            a.sorry(t);
                    }
                }
            });
        },

        binnd_scroll: function (t) {
            t.detail.scrollTop > 100
                ? this.setData({
                      backtop_flag: true
                  })
                : this.setData({
                      backtop_flag: false
                  });
        },

        backtopFn: function (a) {
            var i = 'scrolltopNum_' + a.currentTarget.dataset.id;
            this.setData(t({}, i, 0));
        }
    }
};
</script>
<style>
@import 'help.css';
</style>
